Integrand size = 30, antiderivative size = 94 \[ \int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx=\frac {i (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n}{d (1-n)}-\frac {i (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^{1+n}}{a d \left (1-n^2\right )} \]
I*(e*sec(d*x+c))^(-1-n)*(a+I*a*tan(d*x+c))^n/d/(1-n)-I*(e*sec(d*x+c))^(-1- n)*(a+I*a*tan(d*x+c))^(1+n)/a/d/(-n^2+1)
Time = 1.29 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.62 \[ \int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx=-\frac {i (e \sec (c+d x))^{-1-n} (n-i \tan (c+d x)) (a+i a \tan (c+d x))^n}{d (-1+n) (1+n)} \]
((-I)*(e*Sec[c + d*x])^(-1 - n)*(n - I*Tan[c + d*x])*(a + I*a*Tan[c + d*x] )^n)/(d*(-1 + n)*(1 + n))
Time = 0.42 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.03, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3042, 3985, 3042, 3969}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-1} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-1}dx\) |
\(\Big \downarrow \) 3985 |
\(\displaystyle \frac {\int (e \sec (c+d x))^{-n-1} (i \tan (c+d x) a+a)^{n+1}dx}{a (1-n)}+\frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-1}}{d (1-n)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (e \sec (c+d x))^{-n-1} (i \tan (c+d x) a+a)^{n+1}dx}{a (1-n)}+\frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-1}}{d (1-n)}\) |
\(\Big \downarrow \) 3969 |
\(\displaystyle \frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-1}}{d (1-n)}-\frac {i (a+i a \tan (c+d x))^{n+1} (e \sec (c+d x))^{-n-1}}{a d (1-n) (n+1)}\) |
(I*(e*Sec[c + d*x])^(-1 - n)*(a + I*a*Tan[c + d*x])^n)/(d*(1 - n)) - (I*(e *Sec[c + d*x])^(-1 - n)*(a + I*a*Tan[c + d*x])^(1 + n))/(a*d*(1 - n)*(1 + n))
3.5.86.3.1 Defintions of rubi rules used
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( x_)])^(n_), x_Symbol] :> Simp[b*(d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/ (a*f*m)), x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0] && EqQ [Simplify[m + n], 0]
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( x_)])^(n_), x_Symbol] :> Simp[a*(d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/ (b*f*(m + 2*n))), x] + Simp[Simplify[m + n]/(a*(m + 2*n)) Int[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m, n} , x] && EqQ[a^2 + b^2, 0] && ILtQ[Simplify[m + n], 0] && NeQ[m + 2*n, 0]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 7.10 (sec) , antiderivative size = 2484, normalized size of antiderivative = 26.43
-1/2*I/(1+n)/d*e^(-n)*a^n/e*exp(I*(d*x+c))^n*exp(1/2*I*(2*c+Pi*csgn(I*e*ex p(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3+csgn(I*a*exp(2*I*(d*x+c))/(exp(2*I*(d *x+c))+1))^2*csgn(I*a)*Pi*n+2*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*( d*x+c)))*n-Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n+2*d*x+n* Pi*csgn(I*e)*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*e*exp(I*(d *x+c))/(exp(2*I*(d*x+c))+1))-csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c))) ^3*Pi*n-csgn(I*a*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3*Pi*n-Pi*csgn(I*e xp(2*I*(d*x+c)))^3*n+csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*Pi*cs gn(I/(exp(2*I*(d*x+c))+1))*n+csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c))) ^2*Pi*csgn(I*exp(2*I*(d*x+c)))*n+csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+ c)))*csgn(I*a*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*Pi*n-Pi*csgn(I*e)*c sgn(I*e*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2-Pi*csgn(I/(exp(2*I*(d*x+c)) +1))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2-Pi*csgn(I*exp(I*(d*x+c) ))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+n*Pi*csgn(I*exp(I*(d*x+c) )/(exp(2*I*(d*x+c))+1))^3+Pi*csgn(I*e)*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x +c))+1))*csgn(I*e*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))-Pi*csgn(I*exp(I*(d* x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*e*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^ 2+n*Pi*csgn(I*e*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3-n*Pi*csgn(I*exp(I*( d*x+c)))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2-n*Pi*csgn(I*e)*csgn (I*e*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+Pi*csgn(I/(exp(2*I*(d*x+c))...
Time = 0.25 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.37 \[ \int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx=\frac {{\left ({\left (-i \, n + i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - i \, n - i\right )} \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{-n - 1} e^{\left (i \, d n x + i \, c n + n \log \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right ) + n \log \left (\frac {a}{e}\right )\right )}}{d n^{2} + {\left (d n^{2} - d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - d} \]
((-I*n + I)*e^(2*I*d*x + 2*I*c) - I*n - I)*(2*e*e^(I*d*x + I*c)/(e^(2*I*d* x + 2*I*c) + 1))^(-n - 1)*e^(I*d*n*x + I*c*n + n*log(2*e*e^(I*d*x + I*c)/( e^(2*I*d*x + 2*I*c) + 1)) + n*log(a/e))/(d*n^2 + (d*n^2 - d)*e^(2*I*d*x + 2*I*c) - d)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 246 vs. \(2 (71) = 142\).
Time = 0.51 (sec) , antiderivative size = 246, normalized size of antiderivative = 2.62 \[ \int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx=\begin {cases} x \left (e \sec {\left (c \right )}\right )^{- n - 1} \left (i a \tan {\left (c \right )} + a\right )^{n} & \text {for}\: d = 0 \\\frac {d x \tan {\left (c + d x \right )}}{2 a d \tan {\left (c + d x \right )} - 2 i a d} - \frac {i d x}{2 a d \tan {\left (c + d x \right )} - 2 i a d} + \frac {1}{2 a d \tan {\left (c + d x \right )} - 2 i a d} & \text {for}\: n = -1 \\\frac {\frac {a x \tan ^{2}{\left (c + d x \right )}}{2 \sec ^{2}{\left (c + d x \right )}} + \frac {a x}{2 \sec ^{2}{\left (c + d x \right )}} + \frac {a \tan {\left (c + d x \right )}}{2 d \sec ^{2}{\left (c + d x \right )}} - \frac {i a}{2 d \sec ^{2}{\left (c + d x \right )}}}{e^{2}} & \text {for}\: n = 1 \\- \frac {i n \left (e \sec {\left (c + d x \right )}\right )^{- n - 1} \left (i a \tan {\left (c + d x \right )} + a\right )^{n}}{d n^{2} - d} - \frac {\left (e \sec {\left (c + d x \right )}\right )^{- n - 1} \left (i a \tan {\left (c + d x \right )} + a\right )^{n} \tan {\left (c + d x \right )}}{d n^{2} - d} & \text {otherwise} \end {cases} \]
Piecewise((x*(e*sec(c))**(-n - 1)*(I*a*tan(c) + a)**n, Eq(d, 0)), (d*x*tan (c + d*x)/(2*a*d*tan(c + d*x) - 2*I*a*d) - I*d*x/(2*a*d*tan(c + d*x) - 2*I *a*d) + 1/(2*a*d*tan(c + d*x) - 2*I*a*d), Eq(n, -1)), ((a*x*tan(c + d*x)** 2/(2*sec(c + d*x)**2) + a*x/(2*sec(c + d*x)**2) + a*tan(c + d*x)/(2*d*sec( c + d*x)**2) - I*a/(2*d*sec(c + d*x)**2))/e**2, Eq(n, 1)), (-I*n*(e*sec(c + d*x))**(-n - 1)*(I*a*tan(c + d*x) + a)**n/(d*n**2 - d) - (e*sec(c + d*x) )**(-n - 1)*(I*a*tan(c + d*x) + a)**n*tan(c + d*x)/(d*n**2 - d), True))
Time = 0.38 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.20 \[ \int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx=\frac {{\left (-i \, a^{n} n + i \, a^{n}\right )} \cos \left ({\left (d x + c\right )} {\left (n + 1\right )}\right ) + {\left (-i \, a^{n} n - i \, a^{n}\right )} \cos \left ({\left (d x + c\right )} {\left (n - 1\right )}\right ) + {\left (a^{n} n - a^{n}\right )} \sin \left ({\left (d x + c\right )} {\left (n + 1\right )}\right ) + {\left (a^{n} n + a^{n}\right )} \sin \left ({\left (d x + c\right )} {\left (n - 1\right )}\right )}{2 \, {\left (e^{n + 1} n^{2} - e^{n + 1}\right )} d} \]
1/2*((-I*a^n*n + I*a^n)*cos((d*x + c)*(n + 1)) + (-I*a^n*n - I*a^n)*cos((d *x + c)*(n - 1)) + (a^n*n - a^n)*sin((d*x + c)*(n + 1)) + (a^n*n + a^n)*si n((d*x + c)*(n - 1)))/((e^(n + 1)*n^2 - e^(n + 1))*d)
\[ \int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx=\int { \left (e \sec \left (d x + c\right )\right )^{-n - 1} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \]
Time = 2.16 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.29 \[ \int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx=-\frac {{\left (\frac {a\,\left (\cos \left (2\,c+2\,d\,x\right )+1+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,c+2\,d\,x\right )+1}\right )}^n\,\left (\sin \left (c+d\,x\right )+\sin \left (3\,c+3\,d\,x\right )+n\,\cos \left (c+d\,x\right )\,3{}\mathrm {i}+n\,\cos \left (3\,c+3\,d\,x\right )\,1{}\mathrm {i}\right )}{2\,d\,e\,\left (\cos \left (2\,c+2\,d\,x\right )+1\right )\,\left (n^2-1\right )\,{\left (\frac {e}{\cos \left (c+d\,x\right )}\right )}^n} \]